package org.springframework.http;

/**
 * 此类源自spring框架，部分代码已经删除
 */
public class MediaType  {

    private static final long serialVersionUID = 2069937152339670231L;

    /**
     * Public constant media type that includes all media ranges (i.e. "&#42;/&#42;").
     */
    public static final MediaType ALL;

    /**
     * A String equivalent of {@link MediaType#ALL}.
     */
    public static final String ALL_VALUE = "*/*";

    /**
     *  Public constant media type for {@code application/atom+xml}.
     */
    public static final MediaType APPLICATION_ATOM_XML;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_ATOM_XML}.
     */
    public static final String APPLICATION_ATOM_XML_VALUE = "application/atom+xml";

    /**
     * Public constant media type for {@code application/x-www-form-urlencoded}.
     */
    public static final MediaType APPLICATION_FORM_URLENCODED;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_FORM_URLENCODED}.
     */
    public static final String APPLICATION_FORM_URLENCODED_VALUE = "application/x-www-form-urlencoded";

    /**
     * Public constant media type for {@code application/json}.
     * @see #APPLICATION_JSON_UTF8
     */
    public static final MediaType APPLICATION_JSON;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_JSON}.
     * @see #APPLICATION_JSON_UTF8_VALUE
     */
    public static final String APPLICATION_JSON_VALUE = "application/json";

    /**
     * Public constant media type for {@code application/json;charset=UTF-8}.
     *
     * <p>This {@link MediaType#APPLICATION_JSON} variant should be used to set JSON
     * content type because while
     * <a href="https://tools.ietf.org/html/rfc7159#section-11">RFC7159</a>
     * clearly states that "no charset parameter is defined for this registration", some
     * browsers require it for interpreting correctly UTF-8 special characters.
     */
    public static final MediaType APPLICATION_JSON_UTF8;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_JSON_UTF8}.
     *
     * <p>This {@link MediaType#APPLICATION_JSON_VALUE} variant should be used to set JSON
     * content type because while
     * <a href="https://tools.ietf.org/html/rfc7159#section-11">RFC7159</a>
     * clearly states that "no charset parameter is defined for this registration", some
     * browsers require it for interpreting correctly UTF-8 special characters.
     */
    public static final String APPLICATION_JSON_UTF8_VALUE = "application/json;charset=UTF-8";

    /**
     * Public constant media type for {@code application/octet-stream}.
     */
    public static final MediaType APPLICATION_OCTET_STREAM;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_OCTET_STREAM}.
     */
    public static final String APPLICATION_OCTET_STREAM_VALUE = "application/octet-stream";

    /**
     * Public constant media type for {@code application/pdf}.
     * @since 4.3
     */
    public static final MediaType APPLICATION_PDF;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_PDF}.
     * @since 4.3
     */
    public static final String APPLICATION_PDF_VALUE = "application/pdf";

    /**
     * Public constant media type for {@code application/problem+json}.
     * @since 5.0
     * @see <a href="https://tools.ietf.org/html/rfc7807#section-6.1">
     *     Problem Details for HTTP APIs, 6.1. application/problem+json</a>
     */
    public static final MediaType APPLICATION_PROBLEM_JSON;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_PROBLEM_JSON}.
     * @since 5.0
     */
    public static final String APPLICATION_PROBLEM_JSON_VALUE = "application/problem+json";

    /**
     * Public constant media type for {@code application/problem+json}.
     * @since 5.0
     * @see <a href="https://tools.ietf.org/html/rfc7807#section-6.1">
     *     Problem Details for HTTP APIs, 6.1. application/problem+json</a>
     */
    public static final MediaType APPLICATION_PROBLEM_JSON_UTF8;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_PROBLEM_JSON_UTF8}.
     * @since 5.0
     */
    public static final String APPLICATION_PROBLEM_JSON_UTF8_VALUE = "application/problem+json;charset=UTF-8";

    /**
     * Public constant media type for {@code application/problem+xml}.
     * @since 5.0
     * @see <a href="https://tools.ietf.org/html/rfc7807#section-6.2">
     *     Problem Details for HTTP APIs, 6.2. application/problem+xml</a>
     */
    public static final MediaType APPLICATION_PROBLEM_XML;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_PROBLEM_XML}.
     * @since 5.0
     */
    public static final String APPLICATION_PROBLEM_XML_VALUE = "application/problem+xml";

    /**
     * Public constant media type for {@code application/rss+xml}.
     * @since 4.3.6
     */
    public static final MediaType APPLICATION_RSS_XML;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_RSS_XML}.
     * @since 4.3.6
     */
    public static final String APPLICATION_RSS_XML_VALUE = "application/rss+xml";

    /**
     * Public constant media type for {@code application/stream+json}.
     * @since 5.0
     */
    public static final MediaType APPLICATION_STREAM_JSON;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_STREAM_JSON}.
     * @since 5.0
     */
    public static final String APPLICATION_STREAM_JSON_VALUE = "application/stream+json";

    /**
     * Public constant media type for {@code application/xhtml+xml}.
     */
    public static final MediaType APPLICATION_XHTML_XML;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_XHTML_XML}.
     */
    public static final String APPLICATION_XHTML_XML_VALUE = "application/xhtml+xml";

    /**
     * Public constant media type for {@code application/xml}.
     */
    public static final MediaType APPLICATION_XML;

    /**
     * A String equivalent of {@link MediaType#APPLICATION_XML}.
     */
    public static final String APPLICATION_XML_VALUE = "application/xml";

    /**
     * Public constant media type for {@code image/gif}.
     */
    public static final MediaType IMAGE_GIF;

    /**
     * A String equivalent of {@link MediaType#IMAGE_GIF}.
     */
    public static final String IMAGE_GIF_VALUE = "image/gif";

    /**
     * Public constant media type for {@code image/jpeg}.
     */
    public static final MediaType IMAGE_JPEG;

    /**
     * A String equivalent of {@link MediaType#IMAGE_JPEG}.
     */
    public static final String IMAGE_JPEG_VALUE = "image/jpeg";

    /**
     * Public constant media type for {@code image/png}.
     */
    public static final MediaType IMAGE_PNG;

    /**
     * A String equivalent of {@link MediaType#IMAGE_PNG}.
     */
    public static final String IMAGE_PNG_VALUE = "image/png";

    /**
     * Public constant media type for {@code multipart/form-data}.
     */
    public static final MediaType MULTIPART_FORM_DATA;

    /**
     * A String equivalent of {@link MediaType#MULTIPART_FORM_DATA}.
     */
    public static final String MULTIPART_FORM_DATA_VALUE = "multipart/form-data";

    /**
     * Public constant media type for {@code text/event-stream}.
     * @since 4.3.6
     * @see <a href="https://www.w3.org/TR/eventsource/">Server-Sent Events W3C recommendation</a>
     */
    public static final MediaType TEXT_EVENT_STREAM;

    /**
     * A String equivalent of {@link MediaType#TEXT_EVENT_STREAM}.
     * @since 4.3.6
     */
    public static final String TEXT_EVENT_STREAM_VALUE = "text/event-stream";

    /**
     * Public constant media type for {@code text/html}.
     */
    public static final MediaType TEXT_HTML;

    /**
     * A String equivalent of {@link MediaType#TEXT_HTML}.
     */
    public static final String TEXT_HTML_VALUE = "text/html";

    /**
     * Public constant media type for {@code text/markdown}.
     * @since 4.3
     */
    public static final MediaType TEXT_MARKDOWN;

    /**
     * A String equivalent of {@link MediaType#TEXT_MARKDOWN}.
     * @since 4.3
     */
    public static final String TEXT_MARKDOWN_VALUE = "text/markdown";

    /**
     * Public constant media type for {@code text/plain}.
     */
    public static final MediaType TEXT_PLAIN;

    /**
     * A String equivalent of {@link MediaType#TEXT_PLAIN}.
     */
    public static final String TEXT_PLAIN_VALUE = "text/plain";

    /**
     * Public constant media type for {@code text/xml}.
     */
    public static final MediaType TEXT_XML;

    /**
     * A String equivalent of {@link MediaType#TEXT_XML}.
     */
    public static final String TEXT_XML_VALUE = "text/xml";

    private static final String PARAM_QUALITY_FACTOR = "q";


    static {
        ALL = valueOf(ALL_VALUE);
        APPLICATION_ATOM_XML = valueOf(APPLICATION_ATOM_XML_VALUE);
        APPLICATION_FORM_URLENCODED = valueOf(APPLICATION_FORM_URLENCODED_VALUE);
        APPLICATION_JSON = valueOf(APPLICATION_JSON_VALUE);
        APPLICATION_JSON_UTF8 = valueOf(APPLICATION_JSON_UTF8_VALUE);
        APPLICATION_OCTET_STREAM = valueOf(APPLICATION_OCTET_STREAM_VALUE);
        APPLICATION_PDF = valueOf(APPLICATION_PDF_VALUE);
        APPLICATION_PROBLEM_JSON = valueOf(APPLICATION_PROBLEM_JSON_VALUE);
        APPLICATION_PROBLEM_JSON_UTF8 = valueOf(APPLICATION_PROBLEM_JSON_UTF8_VALUE);
        APPLICATION_PROBLEM_XML = valueOf(APPLICATION_PROBLEM_XML_VALUE);
        APPLICATION_RSS_XML = valueOf(APPLICATION_RSS_XML_VALUE);
        APPLICATION_STREAM_JSON = valueOf(APPLICATION_STREAM_JSON_VALUE);
        APPLICATION_XHTML_XML = valueOf(APPLICATION_XHTML_XML_VALUE);
        APPLICATION_XML = valueOf(APPLICATION_XML_VALUE);
        IMAGE_GIF = valueOf(IMAGE_GIF_VALUE);
        IMAGE_JPEG = valueOf(IMAGE_JPEG_VALUE);
        IMAGE_PNG = valueOf(IMAGE_PNG_VALUE);
        MULTIPART_FORM_DATA = valueOf(MULTIPART_FORM_DATA_VALUE);
        TEXT_EVENT_STREAM = valueOf(TEXT_EVENT_STREAM_VALUE);
        TEXT_HTML = valueOf(TEXT_HTML_VALUE);
        TEXT_MARKDOWN = valueOf(TEXT_MARKDOWN_VALUE);
        TEXT_PLAIN = valueOf(TEXT_PLAIN_VALUE);
        TEXT_XML = valueOf(TEXT_XML_VALUE);
    }

    /**
     * 此类源自Spring框架中
     * 此方法没意义，只是为了不让类报错
     * @param s
     * @return
     */
    private static MediaType valueOf(String s){
        return null;
    }


}